package com.ssyc.student.fragment;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.ssyc.common.base.LazyBaseFragment;
import com.ssyc.common.view.ZzHorizontalProgressBar;
import com.ssyc.student.R;


/**
 * 学生端--个人信息--宠物信息
 */

public class StudentPetInfoFragment extends LazyBaseFragment {

    //昵称
    private TextView tvNickName;
    //性别
    private TextView tvSexType;
    //生日
    private TextView tvBirthday;
    private ZzHorizontalProgressBar pbLever;
    //等级
    private TextView tvNum;
    //等级数字100/250
    private TextView tvLever;
    //智
    private TextView tvZhiNum;
    //勇
    private TextView tvYongNum;
    //欢
    private TextView tvHuanNum;
    //爱
    private TextView tvAiNum;


    //单例模式
    private static volatile StudentPetInfoFragment studentPetInfoFragment;

    public static StudentPetInfoFragment newInstance() {
        if (studentPetInfoFragment == null) {
            synchronized (StudentPetInfoFragment.class) {
                if (studentPetInfoFragment == null) {
                    studentPetInfoFragment = new StudentPetInfoFragment();
                }
            }
        }
        return studentPetInfoFragment;
    }


    @Override
    protected int getLayoutId() {
        return R.layout.fragment_student_pet_info;
    }

    @Override
    protected boolean isNeedShowTitle() {
        return false;
    }

    @Override
    protected String setTitleText() {
        return null;
    }

    @Override
    public void lazyInit(View view, Bundle savedInstanceState) {
        initView(view);
        showContent();

        //设置数据
        initData();
    }


    /**
     * 初始化View
     */
    private void initView(View view) {
        tvNickName = view.findViewById(R.id.tv_nick_name);
        tvSexType = view.findViewById(R.id.tv_sex_type);
        tvBirthday = view.findViewById(R.id.tv_birthday);
        pbLever = view.findViewById(R.id.pb_lever);
        tvNum = view.findViewById(R.id.tv_num);
        tvLever = view.findViewById(R.id.tv_lever);
        tvZhiNum = view.findViewById(R.id.tv_zhi_num);
        tvYongNum = view.findViewById(R.id.tv_yong_num);
        tvHuanNum = view.findViewById(R.id.tv_huan_num);
        tvAiNum = view.findViewById(R.id.tv_ai_num);
    }

    /**
     * 设置数据的方法
     */
    private void initData() {
        pbLever.setProgress(33);
        pbLever.setBgColor(getResources().getColor(R.color.pb_bg));
        pbLever.setProgressColor(getResources().getColor(R.color.state_color));
    }
}
